<?php
/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	mod_banners
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

require_once JPATH_ROOT . '/components/com_banners/helpers/banner.php';
$baseurl = JURI::base();
?>
<?php foreach($list as $item):?>
	<?php $imageurl = $item->params->get('imageurl');?>
	<?php $width = $item->params->get('width');?>
	<?php $height = $item->params->get('height');?>
	<?php if (BannerHelper::isImage($imageurl)) :?>
		<?php // Image based banner ?>
		<?php $alt = $item->params->get('alt');?>
		<?php $alt = $alt ? $alt : $item->name ;?>
		<?php $alt = $alt ? $alt : JText::_('MOD_BANNERS_BANNER') ;?>
		<a
			href="<?php echo $link;?>"
			title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8');?>">
			<img
				src="<?php echo $baseurl . $imageurl;?>"
				alt="<?php echo $alt;?>"
				<?php if (!empty($width)) echo 'width ="'. $width.'"';?>
				<?php if (!empty($height)) echo 'height ="'. $height.'"';?>
			/>
		</a>
		<?php endif;?>
<?php endforeach; ?>